package me.zhengjie.minbearwcs.entity.PO.wcs.mission.history;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhengjie.minbearwcs.entity.PO.wcs.mission.status.MissionStatus;
import me.zhengjie.minbearwcs.entity.PO.wcs.mission.type.MissionType;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* wcs任务
* @TableName wcs_mission_history
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WcsMissionHistory implements Serializable {

    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 任务id
     */
    private String missionId;
    /**
     * 出库单号
     */
    private String orderCode;
    /**
     * 任务类型
     */
    private String missionType;
    /**
     * 任务状态
     */
    private String missionStatus;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 开始时间
     */
    private LocalDateTime startTime;
    /**
     * 结束时间
     */
    private LocalDateTime finishTime;
    /**
     * 优先级  ，1-100,数值越高，优先级越高
     */
    private Integer priority;
    /**
     * 关联出入库单明细id
     */
    private String associatedDetailId;


    public MissionType getEnumMissionType(){
        return MissionType.valueOf(this.missionType);
    }

    public MissionStatus getEnumMissionStatus(){
        return getEnumMissionType().getMissionStatus(this.missionStatus);
    }

}
